const express = require('express');
const router = express.Router();
const userController = require('../controllers/userController');
const authMiddleware = require('../middleware/auth');

// 公开路由
router.post('/register', userController.register);
router.post('/login', userController.login);
router.post('/forgot-password', userController.forgotPassword);

// 需要认证的路由
router.get('/profile', authMiddleware, userController.getCurrentUser);
router.put('/change-password', authMiddleware, userController.changePassword);

module.exports = router;